import React, { Component } from "react";
import List from "./list";
import Compute from "./compute";
import { NavLink, Link } from "react-router-dom";
class View extends Component {
  render() {
    return (
      <div>
        <Link to="/product">产品</Link>
        <Link to="/about">about</Link>
        <NavLink exact to="/product">
          产品
        </NavLink>
        <NavLink to="/about">about</NavLink>
        <NavLink to="/info">info</NavLink>

        {!this.props.match.params.id ? (
          <List />
        ) : (
          <Compute id={this.props.match.params.id} />
        )}
      </div>
    );
  }
}

export default View;
